<template>
  <!-- Tabbar 标签栏 -->
  <van-tabbar v-model="TabBarData" active-color="#ee0a24">
    <van-tabbar-item v-for="(item,index) in PathData" :key="item.id" :to="item.to" :icon="item.icon">
      {{ item.name }}
    </van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import {defineProps, ref, toRef} from "vue";

//子组件接收父组件的值
const props = defineProps({
  TabBar_data: {
    type: Number
  },
  path_data: {
    type: Array,
    default: [
      {id: 1, to: '/home', icon: 'wap-home-o', name: '兑换首页'},
      {id: 2, to: '/instructionsView', icon: 'orders-o', name: '活动说明及积分规则'},
      {id: 3, to: '/orderListView', icon: 'contact', name: '兑换订单'},
    ]
  }
})

const TabBarData = toRef(props, 'TabBar_data')

const PathData = toRef(props, 'path_data')
</script>

<style scoped>

</style>
